package com.hu.ta.assignment6.beans;

public enum EmailClass {
	SPAM(true),
	HAM(false);
	
	private boolean spam;
	
	EmailClass(boolean isSpam) {
		this.spam = isSpam;
	}
	
	EmailClass(String strClass) {
		this.spam = strClass.equals("1");
	}
	
	public boolean isSpam() {
		return this.spam;
	}
	
	public String getLingPipeClass() {
		return (this.spam?"1":"0");
	}
	
	public static EmailClass getClass(String strClass) {
		if(		strClass.equals("1") )
		{
			return SPAM;
		}
		else {
			return HAM;
		}
	}
}
